from django.db import models

class Opera(models.Model):
    operaId = models.CharField(max_length=20, verbose_name="作品号")
    title = models.CharField(max_length=50, verbose_name="作品名")
    typeName = models.CharField(max_length=20, verbose_name="类别/流派")
    artist = models.CharField(max_length=20, verbose_name="作者")
    desc = models.TextField(verbose_name="描述")
    cover = models.ImageField(verbose_name="封面")
    link = models.CharField(max_length=100,verbose_name='观看链接')
    # 后台显示的别名
    class Meta:
        verbose_name_plural = "戏曲"

    # 后台列表显示的字段
    def __str__(self):
        return self.title
